//
//  VOHMoreView.m
//  VoiceOfHeart
//
//  Created by 吉龙 on 16/8/22.
//  Copyright © 2016年 吉龙. All rights reserved.
//

#import "VOHMoreView.h"
@interface VOHMoreView()
@end

@implementation VOHMoreView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setUpView];
    }
    return self;
}

-(void)setUpView{
    self.backgroundColor = [UIColor whiteColor];
    NSArray *array = @[@"最火", @"最近更新", @"经典"];
    self.segment = [[UISegmentedControl alloc] initWithItems:array];
    self.segment.bounds = CGRectMake(0, 0, 250, 30);
    [self addSubview:self.segment];
    NSDictionary *disSelect = @{NSForegroundColorAttributeName:[UIColor jinjuse]};
    [self.segment setTitleTextAttributes:disSelect forState:UIControlStateNormal];
    NSDictionary *select = @{NSForegroundColorAttributeName:[UIColor whiteColor]};
     [self.segment setTitleTextAttributes:select forState:UIControlStateSelected];
    self.tintColor = [UIColor jinjuse];
    self.segment.selectedSegmentIndex = 0;
    self.moreTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.segment.bounds.size.height + 84, ScreenWidth, ScreenHeight - self.moreTableView.frame.origin.y)];
    [self addSubview:self.moreTableView];
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.segment.center = CGPointMake(self.center.x, 84);
}



@end
